#-------------------------------------------------
#
# Project created by QtCreator 2012-08-22T10:12:40
#
#-------------------------------------------------
QT       += network
QT       += core
QT       += sql
QT       += testlib
QT       -= gui


TARGET   = TL2Server
CONFIG   += console
CONFIG   -= app_bundle
DEPENDPATH += .
INCLUDEPATH += .

TEMPLATE = app
LIBS += -lQCryptopp

CONFIG(release, debug|release) {
    DESTDIR += release
} else {
    DESTDIR += debug
}


#for Windows
win32 {
#   Windows without bash
#   copyfiles.commands += @echo COPYING ADDITIONAL FILE/s &
#   copyfiles.commands += @call cd &
#   copyfiles.commands += @call copy ..\\$${TARGET}\\testPkt.txt $${DESTDIR}\\testPkt.txt &
#   copyfiles.commands += @call copy ..\\$${TARGET}\\TL2Server.conf $${DESTDIR}\\TL2Server.conf
#   Windows with bash
    copyfiles.commands += @echo COPYING ADDITIONAL FILE/s &
    copyfiles.commands += cp ../$${TARGET}/testPkt.txt $${DESTDIR}/testPkt.txt &
    copyfiles.commands += cp ../$${TARGET}/TL2Server.conf $${DESTDIR}/TL2Server.conf
}
linux {
#   Linux
    copyfiles.commands += @echo COPYING ADDITIONAL FILE/s &
    copyfiles.commands += cp ../$${TARGET}/testPkt.txt $${DESTDIR}/testPkt.txt &
    copyfiles.commands += cp ../$${TARGET}/TL2Server.conf $${DESTDIR}/TL2Server.conf
}
#rev:$$system(git rev-parse HEAD)-
version_h.commands +="echo '$${LITERAL_HASH}define APP_VER \"$$system(git describe)-$${DESTDIR}\"' > ../$${TARGET}/version.h"

QMAKE_EXTRA_TARGETS += copyfiles
POST_TARGETDEPS += copyfiles

QMAKE_EXTRA_TARGETS += version_h
PRE_TARGETDEPS += version_h

SOURCES += main.cpp \
    handlers/sessionhandler.cpp \
    database/dataserver.cpp \
    network/tlpacket.cpp \
    units/player.cpp \
    units/game.cpp \
    utils/logger.cpp \
    utils/ccreader.cpp \
    ccmd/commandmanager.cpp \
    crypto/loginhelper.cpp \
    crypto/zlibhelper.cpp \
    server/udpsever.cpp \
    server/logonserver.cpp \
    server/clientsocket.cpp \
    utils/configfile.cpp \
    shared/common.cpp \
    units/gamemanager.cpp \
    network/nettools.cpp

HEADERS += \
    main.h \
    database/dataserver.h \
    handlers/sessionhandler.h \
    network/tlpacket.h \
    units/player.h \
    units/game.h \
    utils/logger.h \
    utils/Config.h \
    utils/ccreader.h \
    ccmd/commandmanager.h \
    crypto/loginhelper.h \
    crypto/zlibhelper.h \
    shared/common.h \
    server/udpsever.h \
    server/logonserver.h \
    server/clientsocket.h \
    utils/configfile.h \
    units/gamemanager.h \
    network/nettools.h

OTHER_FILES += \
    libextra.txt \
    ExternalLibs/Cryptopp/cryptopp561.zip \
    testPkt.txt \
    TL2Server.conf \
    dumps/dp1.rar
